package org.jeecg.modules.fxjdh.service.impl;

import org.jeecg.modules.fxjdh.entity.FxjDh11;
import org.jeecg.modules.fxjdh.entity.FxjDh1110;
import org.jeecg.modules.fxjdh.mapper.FxjDh1110Mapper;
import org.jeecg.modules.fxjdh.mapper.FxjDh11Mapper;
import org.jeecg.modules.fxjdh.service.IFxjDh11Service;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 司法催收
 * @Author: zhaodui
 * @Date:   2020-02-22
 * @Version: V1.0
 */
@Service
public class FxjDh11ServiceImpl extends ServiceImpl<FxjDh11Mapper, FxjDh11> implements IFxjDh11Service {

	@Autowired
	private FxjDh11Mapper fxjDh11Mapper;
	@Autowired
	private FxjDh1110Mapper fxjDh1110Mapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		fxjDh1110Mapper.deleteByMainId(id);
		fxjDh11Mapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			fxjDh1110Mapper.deleteByMainId(id.toString());
			fxjDh11Mapper.deleteById(id);
		}
	}
	
}
